<?php
/**
 * Huong Duong Shop functions and definitions
 */

if ( ! function_exists( 'huongduongshop_setup' ) ) :
function huongduongshop_setup() {
	add_editor_style();
	load_theme_textdomain( 'huongduongshop', get_template_directory() . '/languages' );

	add_theme_support( 'post-thumbnails' );

	// This theme uses wp_nav_menu() in two locations.
	register_nav_menus( array(
		'primary' => __( 'Trình đơn chính', 'huongduongshop' )
	) );

	/*
	 * Switch default core markup for search form, comment form, and comments
	 * to output valid HTML5.
	 */
	add_theme_support( 'html5', array(
		'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
	) );
}
endif; // huongduongshop_setup
add_action( 'after_setup_theme', 'huongduongshop_setup' );

/**
 * Register widget area.
 *
 * @since Twenty Fifteen 1.0
 *
 * @link https://codex.wordpress.org/Function_Reference/register_sidebar
 */
function huongduongshop_widgets_init() {
	register_sidebar( array(
		'name'          => __( 'Cột trái', 'huongduongshop' ),
		'id'            => 'sidebar-1',
		'description'   => __( 'Add widgets here to appear in your sidebar.', 'huongduongshop' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
}
add_action( 'widgets_init', 'huongduongshop_widgets_init' );

function huongduongshop_scripts() {
	//css
	wp_enqueue_style( 'huongduongshop-reset-css', get_template_directory_uri() . '/css/reset.css');
	wp_enqueue_style( 'huongduongshop-ie', get_template_directory_uri() . '/css/ie.css');
	wp_enqueue_style( 'huongduongshop-editor', get_template_directory_uri() . '/editor-style.css');
	wp_enqueue_style( 'huongduongshop-style', get_stylesheet_uri() );
	//js
	wp_enqueue_script('customize', get_template_directory_uri() . '/js/customize.js', array('jquery'), '1.0.0', true);
}
add_action( 'wp_enqueue_scripts', 'huongduongshop_scripts' );

/**
 * Customizer additions.
 */
require get_template_directory() . '/inc/customizer.php';
